﻿using System.Threading;
using Sharpduino;
using Sharpduino.Constants;
using Sharpduino.SerialProviders;

namespace ArduninoTest
{
	class TestClass
	{
		
		public TestClass()
		{
			
		}

		public void Start()
		{
			// Create a new connection
			using (var arduino = new ArduinoMega("COM3"))
			{
				var toggle = false;
				while (true)
				{
					if (toggle)
					{
						arduino.SetDO(ArduinoMegaPins.D9_PWM, true);
					}
					else
					{
						arduino.SetDO(ArduinoMegaPins.D9_PWM, false);
					}
					Thread.Sleep(50);
					toggle = !toggle;
				}
			}
			
		}
	}
}
